//
//  external_declaration.h
//  compilation
//
//  Created by Kevin Le perf on 17/01/12.
//  Copyright (c) 2012 e2co technologie. All rights reserved.
//

#ifndef compilation_external_declaration_h
#define compilation_external_declaration_h

/*
 external_declaration
 : function_definition  {printf("external_declaration\n");}
 | declaration {printf("external_declaration\n");}
 ;
 */
struct def_external_declaration{
	void * parent;
	int type;
	struct def_function_definition * function_definition;
	struct def_declaration * declaration;
};

struct def_external_declaration * external_declaration_create(void * parent){
	struct def_external_declaration * f = malloc(sizeof(*f));
	f->parent = parent;
	f->type = 0;
	return f;
}

void external_declaration_print(struct def_external_declaration * f){
	switch(f->type){
		case 1:
			function_definition_print(f->function_definition);
			break;
		case 2:
			declaration_print(f->declaration);
			break;
	}
}
#endif
